package demo.spring.boot.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

/**
 * 使用一个redis服务
 * Created by lushun.chen on 2017/3/13.
 *
 * @author lushun.chen
 */
@Component
public class MyRedis {

    @Autowired
    private StringRedisTemplate template;

    public boolean hasData() {
        boolean b = template.hasKey("myset");

        return b;
    }


}
